package com.ruge.sms.service.impl;

import com.ruge.sms.dao.BlackListRepository;
import com.ruge.sms.domain.model.BlackList;
import com.ruge.sms.domain.request.BlackListRequest;
import com.ruge.sms.service.BlackListService;
import com.ruge.tool.json.JsonTool;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author ruge.wu
 * @since 2021/12/8 14:32
 */
@Service
public class BlackListServiceImpl implements BlackListService {
    @Resource
    private BlackListRepository blackListRepository;

    /**
     * 新增黑名单
     *
     * @param request {@link BlackListRequest}
     */
    @Override
    public void save(BlackListRequest request) {
        BlackList objToBean = JsonTool.getObjToBean(request, BlackList.class);
        blackListRepository.save(objToBean);
    }
}
